package com.example.loginapp.dao;

import com.example.loginapp.model.User;
import java.util.Arrays;
import java.util.List;

import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestBody;

@Repository
public class UserDAO {
    static User[] USERS = new User[]{new User(0L, "admin", "123"), new User(1L, "user", "234"), new User(3L, "zime123", "123456")};

    public UserDAO() {
    }

    public boolean verify(@RequestBody String userName, String password) {
        User[] var3 = USERS;
        int var4 = var3.length;
        //System.out.println(2);
        for(int var5 = 0; var5 < var4; ++var5) {
            User user = var3[var5];
            if (user.getName().equals(userName) && user.getPassword().equals(password)) {
                return true;
            }
        }

        return false;
    }

    public List<User> findAll() {
        return Arrays.asList(USERS);
    }
}
